<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>配送费管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/ivm/delivery/fee/form?id=${deliveryFee.id}">配送费设置</a></li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="deliveryFee" action="${ctx}/ivm/delivery/fee/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<form:hidden path="merchant.id"/>
		<tags:message content="${message}"/>
		<div class="control-group">
			<label class="control-label"><span class="color-red font-size20">*</span>起送金额:</label>
			<div class="controls">
				<form:input path="lowFee" htmlEscape="false" class="input-small required number decimal"/>&nbsp;元
			</div>
		</div>
		<div class="control-group">
			<label class="control-label"><span class="color-red font-size20">*</span>配送费:</label>
			<div class="controls">
				<form:input path="amount" htmlEscape="false" class="input-small required number decimal"/>&nbsp;元
			</div>
		</div>
		<div class="control-group">
			<label class="control-label"><span class="color-red font-size20">*</span>有效日期:</label>
			<div class="controls">
				<input id="beginDate" name="beginDate" type="text" maxlength="50" class="input-small Wdate" style="width: 100px;"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true,maxDate:'#F{$dp.$D(\'endDate\');}'});" value="${deliveryFee.beginDate }"/>
				 至 
				<input id="endDate" name="endDate" type="text" maxlength="50" class="input-small Wdate" style="width: 100px;"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true,minDate:'#F{$dp.$D(\'beginDate\');}'});" value="${deliveryFee.endDate }"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label"><span class="color-red font-size20">*</span>是否启用:</label>
			<div class="controls">
				<form:radiobuttons path="openState" items="${fns:getDictList('yes_no')}" itemLabel="label" itemValue="value" htmlEscape="false" class="required" />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">备注:</label>
			<div class="controls">
				<form:textarea path="remarks" htmlEscape="false" rows="4" maxlength="200" class="input-xxlarge"/>
			</div>
		</div>
		<div class="form-actions">
			<shiro:hasPermission name="ivm:delivery:fee:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>
		</div>
	</form:form>
</body>
</html>
